package com.google.project.server.entity;

import java.io.Serializable;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.project.shared.TaskRequireDTO;

@SuppressWarnings("serial")
@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true")
public class TaskRequire implements Serializable {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	@Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
	private String id;

	@Persistent
	private String projectId;
	@Persistent
	private String projectName;
	@Persistent
	private ProjectTask projectTask;
	@Persistent
	private String taskId;
	@Persistent
	private String taskName;
	@Persistent
	private int numOfEmp;
	@Persistent
	private String specializeId;
	@Persistent
	private String specializeName;
	@Persistent
	private int experience;
	@Persistent
	private Long startDate;
	@Persistent
	private Long dueDate;
	@Persistent
	private String description;
	@Persistent
	private int status;  
	@Persistent
	private int numOfResponse;
	public TaskRequire() {
	}
	public TaskRequire(String id, String projectId, String projectName,
			String taskId, String taskName, int numOfEmp, String specializeId,
			String specializeName, int experience, Long startDate,
			Long dueDate, String description,int status,int numOfResponse) {
		super();
		this.id = id;
		this.projectId = projectId;
		this.projectName = projectName;
		this.taskId = taskId;
		this.taskName = taskName;
		this.numOfEmp = numOfEmp;
		this.specializeId = specializeId;
		this.specializeName = specializeName;
		this.experience = experience;
		this.startDate = startDate;
		this.dueDate = dueDate;
		this.description = description;
		this.status=status;
		this.numOfResponse=numOfResponse;
	}
	public TaskRequire(TaskRequireDTO taskRequireDTO) {
		this.projectId = taskRequireDTO.getProjectId();
		this.projectName = taskRequireDTO.getProjectName();
		this.taskId = taskRequireDTO.getTaskId();
		this.taskName = taskRequireDTO.getTaskName();
		this.numOfEmp = taskRequireDTO.getNumOfEmp();
		this.specializeId = taskRequireDTO.getSpecializeId();
		this.specializeName = taskRequireDTO.getSpecializeName();
		this.experience = taskRequireDTO.getExperience();
		this.startDate = taskRequireDTO.getStartDate();
		this.dueDate = taskRequireDTO.getDueDate();
		this.description = taskRequireDTO.getDescription();
		this.status=taskRequireDTO.getStatus();
		this.numOfResponse=taskRequireDTO.getNumOfResponse();
	}
	public void updateFromDTO(TaskRequireDTO taskRequireDTO) {
		this.projectId = taskRequireDTO.getProjectId();
		this.projectName = taskRequireDTO.getProjectName();
		this.taskId = taskRequireDTO.getTaskId();
		this.taskName = taskRequireDTO.getTaskName();
		this.numOfEmp = taskRequireDTO.getNumOfEmp();
		this.specializeId = taskRequireDTO.getSpecializeId();
		this.specializeName = taskRequireDTO.getSpecializeName();
		this.experience = taskRequireDTO.getExperience();
		this.startDate = taskRequireDTO.getStartDate();
		this.dueDate = taskRequireDTO.getDueDate();
		this.description = taskRequireDTO.getDescription();
		this.status=taskRequireDTO.getStatus();
		this.numOfResponse=taskRequireDTO.getNumOfResponse();
	}
	public TaskRequireDTO toDTO() {
		TaskRequireDTO data = new TaskRequireDTO();
		data.setId(id);
		data.setProjectId(projectId);
		data.setProjectName(projectName);
		data.setTaskId(taskId);
		data.setTaskName(taskName);
		data.setNumOfEmp(numOfEmp);
		data.setSpecializeId(specializeId);
		data.setSpecializeName(specializeName);
		data.setExperience(experience);
		data.setStartDate(startDate);
		data.setDueDate(dueDate);
		data.setDescription(description);
		data.setStatus(status);
		data.setNumOfResponse(numOfResponse);
		return data;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getProjectId() {
		return projectId;
	}
	public void setProjectId(String projectId) {
		this.projectId = projectId;
	}
	public String getProjectName() {
		return projectName;
	}
	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}
	public ProjectTask getProjectTask() {
		return projectTask;
	}
	public void setProjectTask(ProjectTask projectTask) {
		this.projectTask = projectTask;
	}
	public String getTaskId() {
		return taskId;
	}
	public void setTaskId(String taskId) {
		this.taskId = taskId;
	}
	public String getTaskName() {
		return taskName;
	}
	public void setTaskName(String taskName) {
		this.taskName = taskName;
	}
	public int getNumOfEmp() {
		return numOfEmp;
	}
	public void setNumOfEmp(int numOfEmp) {
		this.numOfEmp = numOfEmp;
	}
	public String getSpecializeId() {
		return specializeId;
	}
	public void setSpecializeId(String specializeId) {
		this.specializeId = specializeId;
	}
	public String getSpecializeName() {
		return specializeName;
	}
	public void setSpecializeName(String specializeName) {
		this.specializeName = specializeName;
	}
	public int getExperience() {
		return experience;
	}
	public void setExperience(int experience) {
		this.experience = experience;
	}
	public Long getStartDate() {
		return startDate;
	}
	public void setStartDate(Long startDate) {
		this.startDate = startDate;
	}
	public Long getDueDate() {
		return dueDate;
	}
	public void setDueDate(Long dueDate) {
		this.dueDate = dueDate;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	public int getNumOfResponse() {
		return numOfResponse;
	}
	public void setNumOfResponse(int numOfResponse) {
		this.numOfResponse = numOfResponse;
	}
	
	
}
